package com.qfedu.entity.course11;

public class SqSearch {
    public static void main(String[] args) {
        int[] array = new int[]{10, 11, 12, 13, 14, 15, 16, 17};
        int target = 10;
        int index = search(array, target);
        System.out.println(index);
    }

    public static int search(int[] array, int target) {
        for (int i = 0; i < array.length; i++) {
            if (array[i] == target) {
                return i;
            }
        }
        return -1;
    }
}
